package com.example.exam.entity;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 成绩实体类
 */
public class Score implements Serializable {
    private static final long serialVersionUID = 1L;
    
    private int scoreId;        // 成绩ID
    private String studentId;   // 学生ID
    private String studentName; // 学生姓名
    private int examId;         // 考试ID
    private String courseName;  // 课程名称
    private double score;       // 分数
    private LocalDateTime examDate;      // 考试日期
    private String status;      // 状态(已提交、待批改、已批改)
    
    // 新增字段，用于关联查询
    private String examName;    // 考试名称
    private LocalDateTime examTime;      // 考试时间
    private LocalDateTime submitTime;    // 提交时间
    
    private Exam exam; // 关联的考试对象
    
    // 构造方法
    public Score() {}
    
    public Score(int scoreId, String studentId, String studentName, int examId, 
                 String courseName, double score, LocalDateTime examDate, String status) {
        this.scoreId = scoreId;
        this.studentId = studentId;
        this.studentName = studentName;
        this.examId = examId;
        this.courseName = courseName;
        this.score = score;
        this.examDate = examDate;
        this.status = status;
    }
    
    // Getters and Setters
    public int getScoreId() {
        return scoreId;
    }
    
    public void setScoreId(int scoreId) {
        this.scoreId = scoreId;
    }
    
    public String getStudentId() {
        return studentId;
    }
    
    public void setStudentId(String studentId) {
        this.studentId = studentId;
    }
    
    public String getStudentName() {
        return studentName;
    }
    
    public void setStudentName(String studentName) {
        this.studentName = studentName;
    }
    
    public int getExamId() {
        return examId;
    }
    
    public void setExamId(int examId) {
        this.examId = examId;
    }
    
    public String getCourseName() {
        return courseName;
    }
    
    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }
    
    public double getScore() {
        return score;
    }
    
    public void setScore(double score) {
        this.score = score;
    }
    
    public LocalDateTime getExamDate() {
        return examDate;
    }
    
    public void setExamDate(LocalDateTime examDate) {
        this.examDate = examDate;
    }
    
    public String getStatus() {
        return status;
    }
    
    public void setStatus(String status) {
        this.status = status;
    }
    
    public String getExamName() {
        return examName;
    }
    
    public void setExamName(String examName) {
        this.examName = examName;
    }
    
    public LocalDateTime getExamTime() {
        return examTime;
    }
    
    public void setExamTime(LocalDateTime examTime) {
        this.examTime = examTime;
    }
    
    public LocalDateTime getSubmitTime() {
        return submitTime;
    }
    
    public void setSubmitTime(LocalDateTime submitTime) {
        this.submitTime = submitTime;
    }
    
    public Exam getExam() {
        return exam;
    }
    
    public void setExam(Exam exam) {
        this.exam = exam;
    }
    
    @Override
    public String toString() {
        return "Score{" +
                "scoreId=" + scoreId +
                ", studentId='" + studentId + '\'' +
                ", studentName='" + studentName + '\'' +
                ", examId=" + examId +
                ", courseName='" + courseName + '\'' +
                ", score=" + score +
                ", examDate=" + examDate +
                ", status='" + status + '\'' +
                ", examName='" + examName + '\'' +
                ", examTime=" + examTime +
                ", submitTime=" + submitTime +
                '}';
    }
}    